﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="BuscaFactRep.aspx.cs" Inherits="CROSLAND.WebApp.BuscaFactRep" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<%@ Register assembly="IdeaSparx.CoolControls.Web" namespace="IdeaSparx.CoolControls.Web" tagprefix="cc2" %>

<asp:Content ID="Content6" ContentPlaceHolderID="cphMain" runat="server">
<asp:UpdatePanel ID="upMain" runat="server">

        <ContentTemplate>
        <div style="height:10px"></div>

        <table cellpadding="2" cellspacing="0" class="tbl-detalle" style="width:978px; height:180px">
            <tr>
                <td>Factura SAP</td>
                <td><asp:TextBox ID="txtFactura" runat="server"></asp:TextBox></td>
            </tr>
             <tr>
                <td>Folio legal </td>
                <td><asp:TextBox ID="txtFolio" runat="server"></asp:TextBox></td>
            </tr>
             <tr>
                <td>Fecha factura</td>
                <td>
                    <asp:TextBox ID="txtFechaInicio" runat="server" Width="70" CssClass="inputbox" ReadOnly="false" AutoPostBack="false" Font-Size="10" />
                    <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtFechaInicio" Format="dd/MM/yyyy" CssClass="MyCalendar" />a
                    <asp:TextBox ID="txtFechaFin" runat="server" Width="70" CssClass="inputbox" ReadOnly="false" AutoPostBack="false" Font-Size="10" />  
                    <asp:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtFechaFin" Format="dd/MM/yyyy" CssClass="MyCalendar" />&nbsp;&nbsp;
                    <asp:ImageButton ID="ibtnBuscar" runat="server" ImageAlign="Middle" ImageUrl="~/img/find.png" OnClick="ibtnBuscar_Click" />
        
                </td>
            </tr>
             <tr>
                <td>Cliente(Nombre)</td>
                <td>
                    <asp:TextBox ID="txtCodCliente" runat="server" />   
                </td>
            </tr> 
            <tr>
                <td>Material</td>
                <td><asp:TextBox ID="txtMaterial" runat="server"></asp:TextBox></td>
            </tr>           
            <tr>
                <td>Vendedor</td>
                <td><asp:TextBox ID="txtVendedor" runat="server"></asp:TextBox></td>
            </tr>
        </table>

        <div style="height:10px"></div>
        
        <cc2:CoolGridView ID="gvListado" runat="server" AutoGenerateColumns="false" 
        CssClass="tbl-detalle" Width="978px" OnRowCommand="gvListado_RowCommand" 
        GridLines="None" ShowHeader="true" DefaultColumnWidth="955px" Height="350px" 
        AllowPaging="True" onpageindexchanged="Page_Load" 
        onpageindexchanging="gvListado_PageIndexChanging" PageSize="12" >
            <Columns>                              
                <asp:TemplateField HeaderText="" HeaderStyle-Width="20px"  ItemStyle-HorizontalAlign="Center">
    <ItemTemplate>
          <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/img/detalle.png" CommandName="Detalle" 
          CommandArgument='<%# ((GridViewRow) Container).RowIndex %>'></asp:ImageButton>

    </ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<table border="0" style="background-color:Transparent;">
    <tr>
        <th style="width:75px;">Factura</th>
        <th style="width:76px">Folio Legal</th>
        <th style="width:90px;">Fec. Factura</th>
        <th style="width:175px;">Cliente</th>
        <th style="width:100px;">Estado Compensación</th>
        <th style="width:110px;">NIF</th>  
        <th style="width:230px;">Vendedor</th>
        <th style="width:70px;">Total</th>
        <th style="width:70px;">Moneda</th>
    </tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table border="0" style="background-color:Transparent; margin-left:3px;">
    <tr style="height:5px;" />
    <tr><td style="text-align:center; width:65px;"><asp:Label ID="lblNumPedido" runat="server" Text='<%# Bind("NumPedidoCorto") %>' /></td>
        <td style="text-align:center; width:65px;"><asp:Label ID="Label2" runat="server" Text='<%# Bind("folioLegal") %>' /></td>
        <td style="text-align:center; width:90px;"><asp:Label ID="Label3" runat="server" Text='<%# Bind("FechaString") %>' /></td>
        <td style="text-align:left; width:170px;"><asp:Label ID="Label4" runat="server" Text='<%# Bind("nomCliente") %>' /></td>    
        <td style="text-align:center; width:90px;"><asp:Label ID="Label5" runat="server" Text='<%# Bind("compensacion") %>' /></td>
        <td style="text-align:center; width:110px;"><asp:Label ID="Label1" runat="server" Text='<%# Bind("CodCliente") %>' /></td>
        <td style="width:200px;"><asp:Label ID="Label7" runat="server" Text='<%# Bind("Vendedor1") %>' /></td>
        <td style="width:80px;text-align:center"><asp:Label ID="Label6" runat="server" Text='<%# Bind("totalFact", "{0:0,0.00}") %>' /></td>       
        <td style="text-align:center; width:60px;"><asp:Label ID="Label8" runat="server" Text='<%# Bind("Moneda") %>' /></td>     
    </tr>
    <tr style="height:5px;" />
    <tr>
        <td colspan="7">
        <asp:GridView ID="gvDetalle" runat="server" AutoGenerateColumns="false" CssClass="tbl-detalle"
                        Width="900px" GridLines="Both" BackColor="Transparent" Visible="false" EmptyDataText="hhh" DataSource='<%# Bind("ListaReserva") %>'>
                <Columns>      
                    <asp:BoundField DataField="posicion" HeaderText="Pos." ItemStyle-HorizontalAlign="Center" />
                    <asp:BoundField DataField="codMaterial" HeaderText="Material" ItemStyle-HorizontalAlign="Center" />
                    <asp:BoundField DataField="descMaterial" HeaderText="Denominación" />                  
                    <asp:BoundField DataField="pedidoSap" HeaderText="Pedido Sap" ItemStyle-HorizontalAlign="Center" />
                </Columns>
            </asp:GridView>
        </td>
    </tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>

    <PagerSettings Mode="NumericFirstLast" />
<AlternatingRowStyle BackColor="Beige" />
    <PagerStyle Font-Size="Medium" />
<HeaderStyle BackColor="Silver" Font-Size="12px" Height="20px" />
    <BoundaryStyle BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" />
      </cc2:CoolGridView>
    </ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
